//Event模块

const MyEmitter=require("events");

const MyEmitter=new MyEmitter();

MyEmitter.on("event_name",function(a,b){
    console.log(a,b,this,this===MyEmitter);
});

//事件发射器
MyEmitter.emit("event_name","a","b");

//箭头函数的影响
const MyEmitter2=new MyEmitter();
MyEmitter2.on("event_name",(a,b)=>{
    console.log(a,b,this);
});
MyEmitter2.emit("event_name","a","b");